# Customise this file, documentation can be found here:
# https://github.com/KrauseFx/fastlane/tree/master/docs
# All available actions: https://github.com/KrauseFx/fastlane/blob/master/docs/Actions.md
# can also be listed using the `fastlane actions` command

# Change the syntax highlighting to Ruby
# All lines starting with a # are ignored when running `fastlane`

# By default, fastlane will send which actions are used
# No personal data is shared, more information on https://github.com/fastlane/enhancer
# Uncomment the following line to opt out
# opt_out_usage

# If you want to automatically update fastlane if a new version is available:
# update_fastlane

# This is the minimum version number required.
# Update this, if you use features of a newer version
# fastlane_version "1.47.0"

default_platform :ios


platform :ios do
  before_all do
    # ENV["SLACK_URL"] = "https://hooks.slack.com/services/..."
    cocoapods
    
    # increment_build_number
    increment_build_number

    desc "clear_derived_data"
    clear_derived_data

  end

  desc "Pack a new version AS WJ sign"
  lane :deploy_WJ do
    # sigh
    ipa(scheme: "MultipleSign",
        workspace:"MultipleSign.xcworkspace",
        configuration:"Release",
        clean:true,
        identity:"com.remix.mv",
        ipa:"YeahMV_WJ.ipa",
        archive: true,
        embed:"./ProvisioningProfile_WJ_Wild_AdHoc.mobileprovision")

    #gym(scheme: "MultipleSign",
     #   workspace:"MultipleSign.xcworkspace",
      #  configuration:"Release",
       # silent:true,
       # clean:true,
       # output_name:"YeahMV_XH.ipa",
       # codesigning_identity:"iPhone Distribution: han xu (B3C9PH5883)",
       # provisioning_profile_path:"./ProvisioningProfile_WJ_Wild_AdHoc.mobileprovision",
       # export_team_id:"B3C9PH5883")

    # upload ipa to pgyer.com
   # B3C9PH5883//XH   //com.remix.mv
    #GRT532Z4Z7//wj
  end



  desc "Pack a new version AS XH sign"
  lane :deploy_XH do
    # sigh
    #gym(scheme: "MultipleSign",
     #   workspace:"MultipleSign.xcworkspace",
      #  configuration:"Release",
       # silent:true,
       # clean:true,
       # output_name:"YeahMV_XH.ipa",
       # codesigning_identity:"iPhone Distribution: han xu (B3C9PH5883)",
       # provisioning_profile_path:"./AdHoc_com.remix.mv.mobileprovision",
       # export_team_id:"B3C9PH5883")

    # upload ipa to pgyer.com
   # B3C9PH5883//XH   //com.remix.mv
    #GRT532Z4Z7//wj
  end

  desc "Runs all the tests"
  lane :test do
    snapshot
  end

  desc "Submit a new Beta Build to Apple TestFlight"
  desc "This will also make sure the profile is up to date"
  lane :beta do
    # sigh
    gym(scheme: "MultipleSign") # Build your app - more options available
    pilot

    # sh "your_script.sh"
    # You can also use other beta testing services here
  end

#  desc "Deploy a new version to the App Store"
#  lane :deploy do
 #   snapshot
    # sigh
 #   gym(scheme: "MultipleSign") # Build your app - more options available
 #   # deliver(force: true)
    # frameit
 # end

  # You can define as many lanes as you want

  after_all do |lane|
    # This block is called, only if the executed lane was successful
    
    # slack(
    #   message: "Successfully deployed new App Update."
    # )
  end

  error do |lane, exception|
    # slack(
    #   message: exception.message,
    #   success: false
    # )
  end
end



# More information about multiple platforms in fastlane: https://github.com/KrauseFx/fastlane/blob/master/docs/Platforms.md
# All available actions: https://github.com/KrauseFx/fastlane/blob/master/docs/Actions.md
